//
// Decompiled by Jadx - 493ms
//
package fp;

import a.g;
import a.i;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import fg.b;
import fi.c;
import fi.e;
import fi.w;
import fm.m;
import fn.j;
import fn.x;
import fn.y;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import me.plusne.Adapter.Login.h;
import me.plusne.GreenDao.dao.TopLabelDbDao;
import me.plusne.common.Json.JsonDY;
import me.plusne.common.Json.JsonHookStatic;
import o.a;
import org.luckypray.dexkit.query.matchers.AnnotationMatcher;
import org.luckypray.dexkit.query.matchers.ClassMatcher;
import org.luckypray.dexkit.query.matchers.FieldMatcher;
import org.luckypray.dexkit.query.matchers.MethodMatcher;
import org.luckypray.dexkit.result.ClassData;
import org.luckypray.dexkit.result.ClassDataList;
import org.luckypray.dexkit.result.MethodData;
import org.luckypray.dexkit.result.MethodDataList;
import r.f;

@a(init = true, value = "DY")
public final class s extends x {
    public static boolean cp;

    public static void cq() {
        boolean z;
        cp = false;
        JsonHookStatic jsonHookStatic = y.by;
        try {
            List<String> topLabel = jsonHookStatic.getTopLabel();
            w wVar = new w(jsonHookStatic.getActivity());
            wVar.bi("设置要移除的顶部标签");
            wVar.bd();
            wVar.be();
            wVar.bc("选择你要\"移除\"的标签,和抖音首页顶部标签显示顺序一致");
            wVar.bj(fi.e.LIST_ITEM);
            c cVar = new c();
            cVar.setList(new ArrayList());
            cVar.setTitle("");
            cVar.setGroup(false);
            cVar.setGravity(8388611);
            if (topLabel != null && !topLabel.isEmpty()) {
                for (String str : topLabel) {
                    TopLabelDbDao topLabelDbDao = jsonHookStatic.getDb().z;
                    topLabelDbDao.getClass();
                    g gVar = new g(topLabelDbDao);
                    gVar.l(TopLabelDbDao.Properties.Top.f(str), new i[0]);
                    gVar.i(1);
                    m mVar = (m) gVar.k();
                    String str2 = (String) jsonHookStatic.getTopLabelNames().get(str);
                    if (mVar != null) {
                        z = true;
                    } else {
                        z = false;
                    }
                    c.a aVar = new c.a();
                    aVar.setTitle(str2);
                    aVar.setDesc(str);
                    aVar.setKey("");
                    aVar.setSelected(z);
                    aVar.setSwitch(true);
                    cVar.getList().add(aVar);
                }
                wVar.aq.add(cVar);
                b bVar = wVar.y;
                if (bVar != null) {
                    bVar.notifyItemChanged(r0.size() - 1);
                }
                wVar.ae = new h(5);
                wVar.bk();
                wVar.c.setOnDismissListener(new h(1));
                return;
            }
            f i = f.i();
            i.j();
            i.l("未获取到顶部标签列表");
        } catch (Exception e) {
            e.printStackTrace();
            f.i().l(e.getMessage());
        }
    }

    public final void a() {
        MethodMatcher paramTypes;
        MethodData q;
        MethodMatcher usingNumbers;
        ClassDataList v;
        JsonHookStatic jsonHookStatic = y.by;
        jsonHookStatic.setMenuCall("隐藏顶部标签", new h(4));
        j.bf(TextView.class, "setText", new Object[]{CharSequence.class, new a()});
        if (!jsonHookStatic.isExpire() && x.bv()) {
            cg.a.b = fo.c.aa("refresh dialog UI");
            cg.a.c = fo.c.aa("StateController");
            cg.a.f = fo.c.u();
            cg.a.h = fo.c.aa("auto_play_ai_method");
            cg.a.i = fo.c.t(MethodMatcher.create().usingStrings(new String[]{"on_play_completed", "view_holder"}).paramTypes(new Class[]{String.class}));
            if (j.al("com.ss.android.ugc.aweme.feed.controller.PlayerController") == null) {
                cg.a.ah = fo.c.t(MethodMatcher.create().declaredClass(cg.a.i.getClassName()).usingStrings(new String[]{"play_duration"}).paramTypes(new Class[]{String.class}));
                paramTypes = MethodMatcher.create().declaredClass(cg.a.i.getClassName()).usingStrings(new String[]{"on_playing"}).paramTypes(new Class[]{String.class});
            } else {
                cg.a.ah = fo.c.t(MethodMatcher.create().declaredClass("com.ss.android.ugc.aweme.feed.controller.PlayerController").usingStrings(new String[]{"play_duration"}).paramTypes(new Class[]{String.class}));
                paramTypes = MethodMatcher.create().declaredClass("com.ss.android.ugc.aweme.feed.controller.PlayerController").usingStrings(new String[]{"on_playing"}).paramTypes(new Class[]{String.class});
            }
            cg.a.ai = fo.c.t(paramTypes);
            MethodDataList invokes = cg.a.i.getInvokes();
            MethodMatcher declaredClass = MethodMatcher.create().declaredClass(cg.a.f.getName());
            synchronized (fo.c.class) {
                q = fo.c.q(invokes, declaredClass, 0);
            }
            cg.a.g = q;
            FieldMatcher create = FieldMatcher.create();
            ClassData declaredClass2 = cg.a.h.getDeclaredClass();
            Objects.requireNonNull(declaredClass2);
            cg.a.j = fo.c.p(create.declaredClass(declaredClass2.getName()).type("com.ss.android.ugc.aweme.common.widget.VerticalViewPager"));
            MethodMatcher addParamType = MethodMatcher.create().declaredClass("com.ss.android.ugc.aweme.common.widget.VerticalViewPager").addParamType(Integer.TYPE);
            Class cls = Boolean.TYPE;
            fo.c.t(addParamType.addParamType(cls).returnType("void"));
            cg.a.k = fo.c.t(MethodMatcher.create().declaredClass(cg.a.h.getDeclaredClass().getName()).addParamType(MotionEvent.class).paramCount(1).returnType("void"));
            if (jsonHookStatic.getVersionCode() < 300401) {
                usingNumbers = MethodMatcher.create().usingEqStrings(new String[]{"clickType"}).name("invoke").paramTypes(new Class[]{Object.class, Object.class});
            } else if (jsonHookStatic.getVersionCode() < 320601) {
                usingNumbers = MethodMatcher.create().usingEqStrings(new String[]{"clickType", "panel_down_pan"}).addInvoke(MethodMatcher.create().name("setDuration")).addInvoke(MethodMatcher.create().name("alpha")).usingNumbers(new Number[]{150L, Float.valueOf(1.0f)});
            } else {
                usingNumbers = MethodMatcher.create().usingEqStrings(new String[]{"clickType"}).addInvoke(MethodMatcher.create().name("setDuration")).addInvoke(MethodMatcher.create().name("alpha")).addInvoke(MethodMatcher.create().name("animate")).usingNumbers(new Number[]{150L, Float.valueOf(1.0f)});
            }
            cg.a.l = fo.c.t(usingNumbers);
            cg.a.m = fo.c.aa("fullScreen");
            cg.a.n = fo.c.aa("CommentBlackCreated");
            FieldMatcher create2 = FieldMatcher.create();
            ClassData declaredClass3 = cg.a.n.getDeclaredClass();
            Objects.requireNonNull(declaredClass3);
            cg.a.o = fo.c.p(create2.declaredClass(declaredClass3.getName()).type(ViewGroup.class));
            cg.a.p = fo.c.t(MethodMatcher.create().returnType("void").usingStrings(new String[]{"mode"}).paramTypes(new String[]{"com.ss.android.ugc.aweme.comment.constants.CommentColorMode"}).declaredClass(ClassMatcher.create().addMethod(MethodMatcher.create().returnType("androidx.lifecycle.MutableLiveData").paramCount(0)).addMethod(MethodMatcher.create().returnType("com.ss.android.ugc.aweme.comment.constants.CommentColorMode"))));
            cg.a.q = fo.c.aa("DownNew");
            cg.a.r = fo.c.aa("Down");
            cg.a.s = fo.c.p(FieldMatcher.create().declaredClass("com.ss.android.ugc.aweme.feed.adapter.VideoViewHolder").type(View.class));
            cg.a.t = fo.c.p(FieldMatcher.create().declaredClass("com.ss.android.ugc.aweme.main.MainFragment").type("com.ss.android.ugc.aweme.homepage.ui.titlebar.MainTitleBar"));
            cg.a.u = fo.c.aa("View_BottomTab");
            cg.a.v = fo.c.p(FieldMatcher.create().declaredClass("com.ss.android.ugc.aweme.feed.adapter.VideoViewHolder").type(FrameLayout.class));
            cg.a.w = fo.c.t(MethodMatcher.create().paramTypes(new Class[]{Float.TYPE}).returnType("void").usingStrings(new String[]{"homepage_square"}).usingNumbers(new Number[]{8}));
            cg.a.x = fo.c.t(MethodMatcher.create().usingStrings(new String[]{"mRootView.findViewById(R…exchange_aweme_container)"}));
            if (jsonHookStatic.getVersionCode() < 300401) {
                cg.a.z = fo.c.t(MethodMatcher.create().returnType("void").usingNumbers(new Number[]{228, 224, 305, 0}).usingStrings(new String[]{"state"}).modifiers(16));
                cg.a.aa = fo.c.t(MethodMatcher.create().returnType(cls).paramTypes(new Class[]{View.class}).addUsingField(FieldMatcher.create().type(cg.a.z.getClassName())).modifiers(16));
                MethodData aa = fo.c.aa("LongButtonComment3");
                cg.a.ab = aa;
                ClassData declaredClass4 = aa.getDeclaredClass();
                Objects.requireNonNull(declaredClass4);
                cg.a.aj = declaredClass4.getFields();
                FieldMatcher create3 = FieldMatcher.create();
                ClassData declaredClass5 = cg.a.aa.getDeclaredClass();
                Objects.requireNonNull(declaredClass5);
                cg.a.y = fo.c.p(create3.declaredClass(declaredClass5.getName()).type(cg.a.z.getClassName()));
            }
            cg.a.ac = fo.c.aa("Message");
            MethodMatcher create4 = MethodMatcher.create();
            ClassData declaredClass6 = cg.a.ac.getDeclaredClass();
            Objects.requireNonNull(declaredClass6);
            cg.a.ad = fo.c.t(create4.declaredClass(declaredClass6.getName()).usingNumbers(new Number[]{0, 8}).paramTypes(new String[]{"com.bytedance.im.core.model.Message"}));
            cg.a.ae = fo.c.aa("publishComment");
            cg.a.af = fo.c.p(FieldMatcher.create().declaredClass("com.ss.android.ugc.aweme.following.model.FollowingItemList").type(List.class));
            Iterator it = fo.c.t(MethodMatcher.create().usingEqStrings(new String[]{"homepage_hot_container", "homepage_hot_container"}).returnType(String.class).paramCount(0).modifiers(16).addInvoke(MethodMatcher.create().name("contains"))).getInvokes().iterator();
            MethodData methodData = null;
            while (it.hasNext()) {
                MethodData methodData2 = (MethodData) it.next();
                if (methodData2.getReturnType() != null && methodData2.getReturnType().getName().equals(List.class.getName())) {
                    methodData = methodData2;
                }
            }
            j.bi(new Object[]{"interfaceMethod", methodData});
            ClassMatcher addInterface = ClassMatcher.create().addInterface(methodData.getClassName());
            synchronized (fo.c.class) {
                v = fo.c.v(y.by.getBridge(), addInterface);
            }
            cg.a.ag = v;
            MethodData t = fo.c.t(MethodMatcher.create().name("publishComment").addAnnotation(AnnotationMatcher.create().usingStrings(new String[]{"/aweme/v1/comment/publish/"})));
            jsonHookStatic.getDy().setPublishCommentStr(t.getClassName());
            jsonHookStatic.getDy().setPublishCommentParamCount(t.getParamCount());
            jsonHookStatic.getDy().setPublishCommentClassDataList(t.getParamTypes());
            jsonHookStatic.getDy().setParamAnnotations(t.getParamAnnotations());
            jsonHookStatic.getDy().setApiClass(fo.c.p(FieldMatcher.create().declaredClass(fo.c.n(ClassMatcher.create().usingStrings(new String[]{"mRetrofitService.propagateCompatibleException(e)"})).getName()).type("com.ss.android.ugc.aweme.framework.services.IRetrofit")));
            jsonHookStatic.getDy().setMethodData_get(fo.c.t(MethodMatcher.create().paramCount(0).returnType(fo.c.t(MethodMatcher.create().usingStrings(new String[]{"DanmakuMarkHelper$Mark:%s,%s,%s,%s"})).getClassName()).modifiers(24)));
            JsonDY dy = jsonHookStatic.getDy();
            ClassData returnType = jsonHookStatic.getDy().getMethodData_get().getReturnType();
            Objects.requireNonNull(returnType);
            dy.setPublishCommentFieldDataList(returnType.getFields());
            jsonHookStatic.getDy().setDisLikeAweme(fo.c.t(MethodMatcher.create().paramTypes(new String[]{"com.ss.android.ugc.aweme.feed.model.Aweme", "java.util.Map", "java.lang.String", "java.lang.String", "boolean", "com.ss.android.ugc.aweme.dislike.HandleVideoMethod", "int", "java.lang.Object"})));
        }
    }
}
